/*package com.avilyne.android;

import java.io.InputStream;
import java.security.KeyStore;

 
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.conn.ssl.X509HostnameVerifier;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.SingleClientConnManager;

import android.content.Context;
import android.util.Log;

public class SecureHttpClient extends DefaultHttpClient {
	
    public int securePort;

    public SecureHttpClient(final int port) {
        this.securePort = port;
    }
   //Create SSLSocketFactory and load the keystores
  public SSLSocketFactory createSSLSocketFactor (Context context) {/*
            Log.d("", "Creating SSL socket factory");

            final KeyStore truststore = this.loadStore(context.getResources().openRawResource(R.raw.clienttruststore, "password", "BKS");
            final KeyStore keystore = this.loadStore(context.getResources().openRawResource(R.raw.client, "password", "BKS");

            return this.createFactory(keystore, this.keystorePassword, truststore);*/
/*   }

   
   
   
   
   public SSLSocketFactory createFactory(final KeyStore keystore, final String keystorePassword, final KeyStore truststore) {

            SSLSocketFactory factory;
            try {
                factory = new SSLSocketFactory(keystore, this.getKeystorePassword(), truststore);
                factory.setHostnameVerifier((X509HostnameVerifier) SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
            } catch (Exception e) {
                Log.e("", "Caught exception when trying to create ssl socket factory. Reason: " + e.getMessage());
                throw new RuntimeException(e);
            }

            return factory;
   } 
        
        
  //Register a scheme for https   
        
  @Override
  protected ClientConnectionManager createClientConnectionManager() {

       Log.d("", "Creating client connection manager");

       final SchemeRegistry registry = new SchemeRegistry();

       Log.d("", "Adding https scheme for port " + securePort);
       registry.register(new Scheme("https", this.createSSLSocketFactory(), this.securePort));

       return new SingleClientConnManager(getParams(), registry);
   }   
        
   public KeyStore loadStore(InputStream stream, String keystorePw) throws Exception {
	   try {
	     trustStore.load(stream, keystorePw.toCharArray());
	   }
	   finally {
	     instream.close();
	   }
	   return trustStore;
	 }
        
        
        
        
        
        
    }
}*/